package com.kantboot.business.shop.web.controller;

import com.kantboot.business.shop.repository.BusShopGoodsTypeHasChildrenRepository;
import com.kantboot.global.rest.result.CommonSuccessStateCodeAndMsg;
import com.kantboot.util.common.result.RestResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商品类型控制器
 */
@RestController
@RequestMapping(value = "/business-shop-web/shopGoodsType")
public class BusShopGoodsTypeController {

    @Resource
    private BusShopGoodsTypeHasChildrenRepository shopGoodsTypeHasChildrenRepository;

    /**
     * 获取所有的商品类型（有子节点）
     */
    @RequestMapping(value = "/getAllHasChildren")
    public RestResult<?> getAllHasChildren() {
        return RestResult.success(shopGoodsTypeHasChildrenRepository.getAll(), CommonSuccessStateCodeAndMsg.GET_SUCCESS);
    }

}
